#pragma once
#include <map>
#include <memory>
#include <fstream>

class Node_Base;
class Material_Base;
class Section_Base;
class Element_Base;
class Boundary_Base;
class Load_Base;

class Struct_Data
{
public:
	std::map<int, std::shared_ptr<Node_Base>> m_Node;
	std::map<int, std::shared_ptr<Material_Base>> m_Material;
	std::map<int, std::shared_ptr<Section_Base>> m_Section;
	std::map<int, std::shared_ptr<Element_Base>> m_Element;
	std::map<int, std::shared_ptr<Boundary_Base>> m_Boundary;
	std::map<int, std::shared_ptr<Load_Base>> m_Load;

	bool Input();

private:
	void ReadNode(std::ifstream& fin);
	void ReadMaterial(std::ifstream& fin);
	void ReadSection(std::ifstream& fin);
	void ReadElement(std::ifstream& fin);
	void ReadBoundary(std::ifstream& fin);
	void ReadLoad(std::ifstream& fin);

	std::shared_ptr<Node_Base> FindNode(int idEntity);
	std::shared_ptr<Material_Base> FindMaterial(int idEntity);
	std::shared_ptr<Section_Base> FindSection(int idEntity);
	std::shared_ptr<Element_Base> FindElement(int idEntity);

	void Sectionmesh();
};

